package com.rules.admin.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rules.admin.dao.ErrLogModelDao;
import com.rules.admin.entity.ErrLogModel;
import com.rules.admin.entity.ErrLogQueryModel;
import com.rules.admin.service.ErrLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ErrLogServiceImpl extends ServiceImpl<ErrLogModelDao, ErrLogModel> implements ErrLogService {


   public IPage<ErrLogModel> getPage(String packageName, Date startTime, Date endTime, String username, IPage<ErrLogModel> page, String projectName, String[] projectsName) {


      LambdaQueryWrapper<ErrLogModel> queryWrapper = new LambdaQueryWrapper<>();
      queryWrapper.eq(ErrLogModel::getPackageName, packageName);
      //queryWrapper.eq(ErrLogModel::getStartTime, startTime);
      //queryWrapper.eq(ErrLogModel::getEndTime, endTime);
      queryWrapper.eq(ErrLogModel::getUsername, username);
      queryWrapper.eq(ErrLogModel::getProjectName, projectName);
      //queryWrapper.eq(ErrLogModel::getProjectsName, projectsName);

      return this.baseMapper.selectPage(page, queryWrapper);

   }


}
